package com.fwtai.web;

import com.fwtai.bean.PageFormData;
import com.fwtai.datasource.DaoHandle;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 财务明细访问数据库
 * @作者 李宇鹏
 * @版本 v1.0
 * @创建时间 2023-05-30 16:57:22
 * @QQ号码 444141300
 * @Email service@yinlz.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Repository
public class FinancialDetailsDao{

  private final DaoHandle dao;

  public FinancialDetailsDao(final DaoHandle dao){
    this.dao = dao;
  }

  public HashMap<String,Object> queryById(final long kid){
    return dao.queryForHashMap("financial_details.queryById",kid);
  }

  public List<Map<String,Object>> getListData(final PageFormData formData){
    return dao.queryForListMap("financial_details.listData",formData);
  }

  public Integer getListTotal(final PageFormData formData){
    return dao.queryForInteger("financial_details.listTotal",formData);
  }

  public List<HashMap<String,Object>> getOrderDetails(final ArrayList<Long> listParams){
    return dao.queryForListHashMap("financial_details.getOrderDetails",listParams);
  }

  public List<HashMap<String,Object>> getListMoneySum(final PageFormData formData){
    return dao.queryForListHashMap("financial_details.listMoneySum",formData);
  }
}